#!/bin/bash
# SPDX-FileCopyrightText: © Fossology contributors

# SPDX-License-Identifier: FSFAP
# After you build a fossology tarball with fo-mktar,  you can use
# this script to copy the fossology tarball to the multiple agent machines 
# specified in the for loop.
# It then untars, builds and installs fossology on those machines.
# This does not clean up the unpacked tarball on the agent machines.

# Usage: updateagents fossology-1.1.0~20090205.tar.gz

TARFILE=$1
TARDIR=${TARFILE%.tar.gz}

for i in buckbeak fawkes
do
scp $TARFILE $i:~/$TARFILE
ssh $i "tar -xzvf $TARFILE;
        cd $TARDIR;
        make ; 
        sudo make install; ./install.sh -u';"
done

